home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntinc20 / st-out.h < prev    next >
C/C++ Source or Header  |  1992-05-15  |  2KB  |  68 lines

  1. /*    atst.out.h    .1    24Dec85    */
  2. /*
  3.  * Header prepended to each Atari ST .prg file
  4.  */
  5. #ifndef _STAOUT_H
  6. #define _STAOUT_H
  7.  
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12. struct aexec {
  13.      short    a_magic;    /* magic number */
  14. unsigned long    a_text;        /* size of text segment */
  15. unsigned long    a_data;        /* size of initialized data */
  16. unsigned long    a_bss;        /* size of uninitialized data */
  17. unsigned long    a_syms;        /* size of symbol table */
  18. unsigned long    a_AZero1;    /* always zero */
  19. unsigned long    a_ldflgs;    /* program load flags */
  20. #define a_AZero2 a_ldflgs    /* compatibility */
  21. unsigned short    a_isreloc;    /* is reloc info present */
  22. };
  23. #define    CMAGIC    0x601A        /* contiguous text */
  24. #define    ISRELOCINFO    0    /* relocation information is present */
  25.                 /*  any other value - no reloc info  */
  26. /*
  27.  * Macros which take exec structures as arguments and tell whether
  28.  * the file has a reasonable magic number or offsets to text|symbols|strings.
  29.  */
  30. #define    A_BADMAG(x)     (((x).a_magic)!=CMAGIC)
  31. /* this is busted...
  32. #define    A_TXTOFF(x)    ((x).a_magic==ZMAGIC ? 1024 : sizeof (struct exec))
  33. */
  34. #define    A_TXTOFF(x)    (sizeof (struct aexec))
  35. #define A_DATOFF(x)    (A_TXTOFF(x) + (x).a_text)
  36. #define A_SYMOFF(x)    (A_TXTOFF(x) + (x).a_text+(x).a_data)
  37. #define    A_STROFF(x)    (A_SYMOFF(x) + (x).a_syms)
  38.  
  39. /*
  40.  * Format of a symbol table entry
  41.  */
  42. struct    asym 
  43.     {
  44.     char        a_name[8];    /* symbol name */
  45.     unsigned short    a_type;        /* type flag, i.e. N_TEXT etc; see below */
  46.     unsigned long    a_value;    /* value of this symbol (or sdb offset) */
  47.     };
  48.  
  49. /*
  50.  * Simple values for a_type.
  51.  */
  52. #define A_UNDF    0        /* ?? for gas */
  53. #define    A_BSS    0x0100        /* bss */
  54. #define    A_TEXT    0x0200        /* text */
  55. #define    A_DATA    0x0400        /* data */
  56. #define    A_EXT    0x0800        /* external */
  57. #define A_EQREG    0x1000        /* equated register */
  58. #define A_GLOBL    0x2000        /* global */
  59. #define A_EQU    0x4000        /* equated */
  60. #define A_DEF    0x8000        /* defined */
  61. #define A_LNAM  0x0048        /* gst compat long name */
  62.  
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66.  
  67. #endif /* _STAOUT_H */
  68.